package com.he.hsdyc.model;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import javax.persistence.Column;
import javax.persistence.Id;
import java.util.Collection;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: jc
 * Date: 2019-06-14
 * Time: 15:20
 */
@Data
public class User implements UserDetails {

    @Id
    private Long id;

    @Column(name = "user_name")
    private String username;
    private String password;
    private String name;
    private String icon;
    private String tel;
    private Boolean gender;
    private Integer roleName;
    private String auth;
    private Boolean state;
    private Integer subjectType;
    private Date updateTime;
    private Date lastTime;
    private Boolean del;
    private Date createTime;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }



    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }


    public User(String userName, String password) {
        this.username = userName;
        this.password = password;
    }
    public User(String userName, String password, String tel) {
        this.username = userName;
        this.password = password;
        this.tel=tel;
    }

    public User() {

    }



	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", name=" + name + ", icon="
				+ icon + ", tel=" + tel + ", gender=" + gender + ", roleName=" + roleName + ", auth=" + auth
				+ ", subjectType=" + subjectType + ", updateTime=" + updateTime + ", del=" + del + ", createTime="
				+ createTime + "]";
	}
    
    
}
